Skip to content

Fix: Remove duplicate import and improve type checking#1623

Merged
carlosmiei merged 1 commit intosammchardy:masterfrom
xingarr:fix/remove-duplicate-import-and-improve-type-check
Dec 10, 2025
Merged

Fix: Remove duplicate import and improve type checking#1623
carlosmiei merged 1 commit intosammchardy:masterfrom
xingarr:fix/remove-duplicate-import-and-improve-type-check

Conversation

@xingarr
Copy link
Copy Markdown
Contributor

@xingarr xingarr commented Nov 4, 2025

Description

This PR addresses two code quality issues found during codebase review:

Changes

  1. Remove duplicate import - OptionsDepthCacheManager was imported twice in binance/init.py (lines 13 and 16)
  2. Improve type checking - Replaced type(ts_str) == int with isinstance(ts_str, int) in helpers.py for better Python practices

Why?

  • Duplicate imports are redundant and can cause confusion
  • isinstance() is the Pythonic way to check types and respects inheritance, while type() comparison does not

Testing

  • Existing tests pass
  • No breaking changes
  • Code follows project style guidelines

@xingarr xingarr requested a review from carlosmiei as a code owner November 4, 2025 11:55
Copy link
Copy Markdown
Collaborator

@pcriadoperez pcriadoperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the contribution!

@carlosmiei carlosmiei merged commit 642eeab into sammchardy:master Dec 10, 2025
8 checks passed
pcriadoperez pushed a commit to pcriadoperez/python-binance that referenced this pull request Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants